<script>
	$(function () {
		$('#myTab a:last').tab('show');
		
		$('#myTab a').click(function (e) {
			e.preventDefault();
			$(this).tab('show');
		})
	
		$('a[data-toggle="tab"]').on('shown', function (e) {
			e.target // activated tab
			e.relatedTarget // previous tab
		});
	})
</script>
<div>
	<div class="span12">
		<h2><?php echo CHtml::encode($shop->name) ?></h2>
	</div>
</div>
<div class="row">

	<div class="span12">
		<ul class="tabs" id="myTab">
			<li class="active"><a data-toggle="tab"  href="#info">Thông tin</a></li>
			<li><a data-toggle="tab" href="#collection">Bộ sưu tập</a></li>
		</ul>
	</div>
	<div class="span810 tab-content">
		<div class="span12" id="info">
			<div class="well sidebar-nav">
				<h3>Thông tin</h3>
				<ul>
					<li>Địa chỉ: <?php echo CHtml::encode($shop->address) ?></li>
					<li>Fanpage <?php echo CHtml::encode($shop->fanpage_url) ?></li>
					<li>Website <?php echo CHtml::encode($shop->website) ?></li>
				</ul>
				<h3>Thông tin liên hệ</h3>
				<?php foreach ($shop_contacts as $shop_contact): ?>
					<ul>
						<li><?php echo CHtml::encode($shop_contact->name); ?></li>
						<li><?php echo CHtml::encode($shop_contact->phone); ?></li>
						<li><?php echo CHtml::encode($shop_contact->im); ?></li>
						<li><?php echo CHtml::encode($shop_contact->email); ?></li>
					</ul>
				<?php endforeach; ?>
				</div>
			</div>
			<div class="span8" id="collection">
				<ul class="grid-layout">
					<h2>Bộ sưu tập</h2>
				<?php foreach ($collections as $collection->items): ?>
						<li>
							<a href="<?php echo Yii::app()->createUrl('site/collection', array('id' => $collection->items->id)); ?>">
								<?php if (strpos($collection->items->image, 'http') === 0): ?>
									<img title="<?php ?>" src="<?php echo $collection->items->image ?>" style="max-height: 83px"/>
								<?php else: ?>
									<img title="<?php ?>" src="<?php echo Yii::app()->request->baseUrl . '/' . $collection->items->image ?>"/>
								<?php endif; ?>
							</a>
							<div class="item-detail">
								<span class="ellipsis"><?php echo CHtml::encode($collection->items->name); ?></span>
							</div>
						</li>
				<?php endforeach; ?>
					</ul>
					<div style="clear: both">&nbsp;</div>
			<?php $this->widget('CLinkPager', array('pages' => $pages)); ?>
		</div>
	</div>
</div>
